function findMostWord(str) {
    let map = new Map()
    for (let i = 0; i < str.length; i++) {
        map.set(str[i], map.get(str[i]) + 1 || 1)
    }
    
    let max = 0;
    let word = "";
    for (const [k, v] of map) {
        if (max < v) {
            max = v
            word = k
        }
    }
    return { k: word, v: max }
}

console.log(findMostWord("aaabbbcdbbsddd"))